<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('需求详情')" />
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: jsonview-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-busReq-detail">
			<input id="reqId" name="reqId" th:field="*{busReq.reqId}"  type="hidden">
			<h4 class="form-header h4">基本信息</h4>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">所属企业：</label>
						<div class="form-control-static" th:text="${busReq.publishDeptName}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">需求名称：</label>
						<div class="form-control-static" th:text="${busReq.reqName}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">需求分类：</label>
						<div class="form-control-static" th:text="${busReq.typeName}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">需求标签：</label>
						<div class="form-control-static" th:text="${busReq.label}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">发布人：</label>
						<div class="form-control-static" th:text="${busReq.publishUserName}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">接收企业：</label>
						<div class="form-control-static" th:text="${busReq.receiveDeptName}"></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">接收人：</label>
						<div class="form-control-static" th:text="${busReq.receiveUserName}"></div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-2 control-label">需求内容：</label>
						<div class="form-control-static"><pre id="reqContent"></pre></div>
					</div>
				</div>
			</div>

			<h4 class="form-header h4">评论列表</h4>

				<div class="btn-group-sm" id="toolbar" role="group">
					<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:busReqComment:remove">
						<i class="fa fa-remove"></i> 删除
					</a>
				</div>

				<div class="col-sm-12 select-table table-striped">
					<table id="bootstrap-table"></table>
				</div>


		</form>
    </div>



	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<th:block th:include="include :: jsonview-js" />


    <script th:inline="javascript">
		var removeFlag = [[${@permission.hasPermi('system:busReqComment:remove')}]];
		var prefix = ctx + "system/busReqComment";

		$(function() {
			var reqContent = [[${busReq.content}]];
			$("#reqContent").text(reqContent);

			var options = {
				url: prefix + "/list",
				removeUrl: prefix + "/remove",
				queryParams: queryParams,
				sortName: "createTime",
				sortOrder: "desc",
				modalName: "评论列表",
				columns: [{
					checkbox: true
				},
					{
						field: 'createTime',
						title: '评论时间',
						width: '20',
						widthUnit: '%'
					},
					{
						field: 'userName',
						title: '评论人',
						width: '15',
						widthUnit: '%'
					},
					{
						field: 'content',
						title: '评论内容',
						width: '50',
						widthUnit: '%',
					},
					{
						title: '操作',
						align: 'center',
						width: '15',
						widthUnit: '%',
						formatter: function(value, row, index) {
							var actions = [];
							actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.commentId + '\')"><i class="fa fa-remove"></i>删除</a>');
							return actions.join('');
						}
					}]
			};
			$.table.init(options);

		});

		function queryParams(params) {
			var search = $.table.queryParams(params);
			search.reqId = $("#reqId").val();;
			return search;
		}

	</script>
</body>
</html>
